<template>
	<view>
		<!-- <u-navbar :is-back="true" :is-fixed="true" title="服务码"></u-navbar> -->
		<scroll-view scroll-y scroll-with-animation style="height: calc(100vh - 110px);" :show-scrollbar="false">
			<free-divider></free-divider>
			<!-- 审核通过显示 -->
			<view class="text-center py-5" style="display: flex; flex-direction: column; align-items: center;">
				<uqrcode ref="uqrcode" canvas-id="qrcode" :value="newList.id" size="150" :options="{ }"
					:h5SaveIsDownload="true" :h5DownloadName="newList.enterpriseName"></uqrcode>
				<view class="py-3">{{newList.enterpriseName}} <text class="ml-3 text-8ED0F2"
						@click="downloadQR">下载</text> </view>
			</view>
			<u-form :model="newList">
				<u-form-item :label-style="labelStyle" label="企业名称" prop="enterpriseName">
					<u-input class="mr-3" :disabled="true" v-model="newList.enterpriseName" input-align="right" />
				</u-form-item>
				<u-form-item :label-style="labelStyle" label="负责人" prop="legalRepresentative">
					<u-input class="mr-3 " v-model="newList.legalRepresentative" :disabled="true" input-align="right" />
				</u-form-item>
				<u-form-item :label-style="labelStyle" label="统一社会信用代码" prop="unifiedCreditCode">
					<u-input class="mr-3 " v-model="newList.unifiedCreditCode" :disabled="true" input-align="right" />
				</u-form-item>
				<u-form-item :label-style="labelStyle" label="收购范围" prop="name">
					<u-input class="mr-3 " v-model="newList.buyScopeText" :disabled="true" input-align="right" />
				</u-form-item>
				<u-form-item :label-style="labelStyle" label="主体地址" prop="name">
					<u-input class="mr-3 " style="margin-left: 40px;" v-model="newList.address" :disabled="true" input-align="right" />
				</u-form-item>
			</u-form>
		</scroll-view>
	</view>
</template>

<script>
	import freeDivider from "@/components/free-ui/free-divider.vue";
	import $H from '@/common/free-lib/request.js';
	export default {
		components: {
			freeDivider,
		},
		data() {
			return {
				newList: {},

				labelStyle: {
					paddingLeft: '13px',
					width: '130px'
				},

				border: true,
			}
		},
		computed: {

		},
		onLoad(options) {
			const id = options.id;
			this.NewUser(id);
		},
		methods: {
			downloadQR() {
				// uqrcode为组件的ref名称
				this.$refs.uqrcode.save({
					success: () => {
						uni.showToast({
							icon: 'success',
							title: '保存成功'
						});
					}
				});
			},
			NewUser(id) {
				$H.get('/brand/user/down/queryServiceCode', {
					id: id
				}, {}).then(res => {
					this.newList = res.result;
					this.publicBrandNameEditable = this.newList.approvalState !== 'success'; // 在完成状态下禁止编辑
					this.productsNameEditable = this.newList.approvalState !== 'success'; // 在完成状态下禁止编辑
				}).catch(error => {
					uni.showToast({
						title: "网络错误，请稍后再试",
						icon: 'none'
					});
				});
			},
		}
	}
</script>

<style>
</style>